﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RecommenderSystem.misc
{
    class ItemNode<T>
    {
        private T attribute;
        private Dictionary<bool, ItemNode<T>> values;

        public double answer {get;set;}

        public bool isLeaf {get;set;}

        public ItemNode(T attribute)
        {
            this.attribute = attribute;
            values = new Dictionary<bool, ItemNode<T>>();
        }


        public void addChild(bool val, ItemNode<T> child)
        {
            values[val] = child;
        }

        public ItemNode<T> getChild(bool child)
        {
            if (values.ContainsKey(child))
            {
                return values[child];
            }

            return null;
        }

        public T getAttribute()
        {
            return attribute;
        }




    }
}
